#include "chars.h"
#include <string.h>
#include <peekpoke.h>
#include <cbm.h>


void setupCharSet(void)
{
	--CIA1.cra;						// Turn off interrupt timer
	POKE(0x01, PEEK(0x01) & ~0x04);	// Switch in character ROM

	// Copy the lower-/upper-case font into VIC-II RAM bank 3.
	memcpy((void*)0x3000, (void*)0xD000, 0x0800);

	POKE(0x01, PEEK(0x01) | 0x04);	// Switch out character ROM
	++CIA1.cra;						// Turn on interrupt timer

	memcpy((void*)(0x3000 + 80*8), chars, 14*8);

	POKE(0xD018, 0x1C);
	POKE(0xDD00, (PEEK(0xDD00) & 0xFC) | 0x03);
}